$(document).ready(function () {

    //省初始化
    getProvinceList();
    //showUserInfo();


});
function getProvinceList() {
    $("#sel_city").html("<option value=\"0\" selected>选择城市</option>");
    $("#sel_area").html("<option value=\"0\" selected>选择区域</option>");
    $.ajax({
        type: "get",
        url: "/Manage/getProvinceList.do",
        timeout: 1000,
        dataType: "json",
        cache: false,
        success: function (data) {
            var strHtml = "<option value=\"0\" selected>选择省份</option>";
            if (data.length > 1) {
                for (var i = 0; i < data.length; i++) {
                    strHtml += "<option value='" + data[i].provinceid + "'>" + data[i].province + "</option>";
                }
            }
            $("#sel_pro").html(strHtml);
        }
    });
}
function getCityList() {
    $("#sel_city").html("<option value=\"0\" selected>选择城市</option>");
    $("#sel_area").html("<option value=\"0\" selected>选择区域</option>");
    $.ajax({
        type: "get",
        url: "/Manage/getCityList.do",
        timeout: 1000,
        data: {id: $.trim($("#sel_pro").val())},
        dataType: "json",
        cache: false,
        success: function (data) {
            var strHtml = "<option value=\"0\" selected>选择城市</option>";
            var citylist = data;
            if (citylist.length > 1) {
                for (var i = 0; i < citylist.length; i++) {
                    strHtml += "<option value='" + citylist[i].cityid + "'>" + citylist[i].city + "</option>";
                }
            }
            $("#sel_city").html(strHtml);
        }
    });
}
function getAreaList() {
    $.ajax({
        type: "get",
        url: "/Manage/getAreaList.do",
        timeout: 1000,
        data: {id: $.trim($("#sel_city").val())},
        dataType: "json",
        cache: false,
        success: function (data) {
            var strHtml = "<option value=\"0\" selected>选择县区</option>";
            var arealist = data;
            if (arealist.length > 1) {
                for (var i = 0; i < arealist.length; i++) {
                    strHtml += "<option value='" + arealist[i].areaid + "'>" + arealist[i].area + "</option>";
                }
            }
            $("#sel_area").html(strHtml);
        }
    });
}